package com.zyk;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ConfigClient {
	@Value("${spring.application.name}")
	private String applicationName;
	@Value("${server.port}")
	private String port;
	@RequestMapping("/config")
	//访问localhost:8080/config失败，原因是bootstrap.yml中配置的profile是什么，访问git上的配置就是什么，profile配置的为prod，远程配置端口为4002,访问路径为localhost:4002/config
	public String getConfig() {
		String content = "applicationName:" + applicationName + ",port:"+port;
		System.out.println(content);
		return content;
		
	}
	public String getApplicationName() {
		return applicationName;
	}
	public void setApplicationName(String applicationName) {
		this.applicationName = applicationName;
	}
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
	
}
